home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat2 / semget.0 < prev    next >
Encoding:
Text File  |  1998-06-15  |  2.8 KB  |  67 lines

  1.  
  2. SEMGET(2)                  UNIX Programmer's Manual                  SEMGET(2)
  3.  
  4. NNAAMMEE
  5.      sseemmggeett - get semaphore set
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  9.      ##iinncclluuddee <<ssyyss//iippcc..hh>>
  10.      ##iinncclluuddee <<ssyyss//sseemm..hh>>
  11.  
  12.      _i_n_t
  13.      sseemmggeett(_k_e_y___t _k_e_y, _i_n_t _n_s_e_m_s, _i_n_t _s_e_m_f_l_g)
  14.  
  15. DDEESSCCRRIIPPTTIIOONN
  16.      The sseemmggeett() system call returns the semaphore identifier associated with
  17.      _k_e_y.
  18.  
  19.      A new set containing _n_s_e_m_s semaphores is created if either _k_e_y is equal
  20.      to IPC_PRIVATE, or _k_e_y does not have a semaphore set associated with it,
  21.      and the IPC_CREAT bit is set in _m_s_g_f_l_g_.
  22.  
  23.      If a new set of semaphores is created, the data structure associated with
  24.      it (the _s_e_m_i_d___d_s structure, see semctl(2))  is intialized as follows:
  25.  
  26.      ++oo   _s_e_m___p_e_r_m_._c_u_i_d and _s_e_m___p_e_r_m_._u_i_d are set to the effective uid of the
  27.          calling process.
  28.  
  29.      ++oo   _s_e_m___p_e_r_m_._g_i_d and _s_e_m___p_e_r_m_._c_g_i_d are set to the effective gid of the
  30.          calling process.
  31.  
  32.      ++oo   _s_e_m___p_e_r_m_._m_o_d_e is set to the lower 9 bits of _m_s_g_f_l_g.
  33.  
  34.      ++oo   _s_e_m___n_s_e_m_s is set to the value of _n_s_e_m_s
  35.  
  36.      ++oo   _s_e_m___c_t_i_m_e is set to the current time
  37.  
  38.      ++oo   _s_e_m___o_t_i_m_e is set to 0
  39.  
  40. RREETTUURRNN VVAALLUUEESS
  41.      sseemmggeett() returns a non-negative semaphore identifier if successful. Oth-
  42.      erwise, -1 is returned and _e_r_r_n_o is set to reflect the error.
  43.  
  44. EERRRROORRSS
  45.      [EACCESS]     The caller has no permission to access a semaphore set al-
  46.                    ready associated with _k_e_y_.
  47.  
  48.      [EEXIST]      Both IPC_CREAT and IPC_EXCL are set in _m_s_g_f_l_g, and a
  49.                    semaphore set is already associated with _k_e_y.
  50.  
  51.      [EINVAL]      _n_s_e_m_s is less than 0 or greater than the system limit for
  52.                    the number in a semaphore set.
  53.  
  54.                    A semaphore set associated with _k_e_y exists, but has fewer
  55.                    semaphores than the number specified in _n_s_e_m_s.
  56.  
  57.      [ENOSPC]      A new set of semaphores could not be created because the
  58.                    system limit for the number of semaphores or the number of
  59.                    semaphore sets has been reached.
  60.  
  61.      [ENOENT]      IPC_CREAT was not set in _m_s_g_f_l_g and no semaphore set asso-
  62.                    ciated with _k_e_y was found.
  63.  
  64. SSEEEE AALLSSOO
  65.      semop(2) semctl(2)
  66.  
  67.